using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FutureOpen.Core;
using FutureOpen.Core.func;
using FutureOpen.Core.func.db;
using FutureOpen.Web.Pages;

public partial class test_Usrcollection : PageBase
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        base.PageInit();
       
        if (!IsPostBack)
        {                                     
            AspNetPager1.RecordCount = GetArtsCount();
            BindArts(0, 20);           
        }
    }

    private void BindArts(int start, int count)
    {
        if (IsLogin())
        {
            MyColl mycoll = new MyColl();
            IList<Art> artList = mycoll.Get(MyUsr, start, count);

            GridView1.DataSource = artList;
            GridView1.DataBind();
        }
    }

    public int GetArtsCount()
    {
        MyColl mycoll = new MyColl();
        return mycoll.GetCount(MyUsr);
    }

    public string GetArtTypeDesc(object artType)
    {
        return ArtType.GetText((short)artType);
    }
    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        BindArts((e.NewPageIndex - 1) * 10, 10);
    }


}
